# _*_coding:utf-8_*_
__author__ = 'gerry'
'''序列化'''

import pickle,json,datetime
dict1 = {'name':'alex',
         'age':44,
         'borndata':datetime.datetime.now()}
f= open('test.pkl','a+')
#print(datetime.datetime.now())



# #f.write('djslkjf;lidsjl')#只能写入字符串，字典，列表都不可以
#
# print(pickle.dumps(dict1))#打印在命令窗口
pickle.dump(dict1,f)#打印在硬盘上，f为文件变量

#json.dump(dict1,f)



f.close()






